/*
 *Created by tangming991 on 2020/12/21.
 * 这里定义了一些关键词 符号的种别码
*/

#ifndef TCOMPILER_GLOBALS_H
#define TCOMPILER_GLOBALS_H

/*单词种别码*/
#define _SYN_INT            1
#define _SYN_MAIN           2
#define _SYN_IF             3
#define _SYN_WHILE          4
#define _SYN_FOR            5
#define _SYN_PRINTF         6
#define _SYN_RETURN         7


/*以上为关键词的种别码*/

#define _SYN_ID             10  /*标识符的单词的种别码*/
#define _SYN_NUM            11  /*整数的单词种别码*/

#define _SYN_ASSIGN         21  /*  =   */
#define _SYN_PLUS           22  /*  +   */
#define _SYN_MINUS          23  /*  -   */
#define _SYN_TIMES          24  /*  *   */
#define _SYN_DIVIDE         25  /*  /   */
#define _SYN_LPAREN         26  /*  (   */
#define _SYN_RPAREN         27  /*  )   */
#define _SYN_LBRACKET       28  /*  [   */
#define _SYN_RBRACKET       29  /*  ]   */
#define _SYN_LBRACES        30  /*  {   */
#define _SYN_RBRACES        31  /*  }   */
#define _SYN_COMMA          32  /*  ,   */
#define _SYN_COLON          33  /*  :   */
#define _SYN_SEMICOLON      34  /*  ;   */

#define _SYN_LG             35  /*  >   */
#define _SYN_LT             36  /*  <   */
#define _SYN_ME             37  /*  >=  */
#define _SYN_LE             38  /*  <=  */
#define _SYN_EQ             39  /*  ==  */
#define _SYN_NE             40  /*  !=  */
#define _SYN_BAND           41  /*  &  */
#define _SYN_BOR            42  /*  |  */
#define _SYN_AND            43  /*  &&  */
#define _SYN_OR             44  /*  ||  */
#define _SYN_EXC            45  /*  !  */
#define _SYN_STR            50  /*字符串 */
#define _SYN_END            1000/* 结束  */
#define _SYN_ERROR          -1  /* ERROR*/

#include <string>
class Word{
public:
    int syn;
    std::string value;
};
extern  int line;
extern std::string sources;
#endif //TCOMPILER_GLOBALS_H
